﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPFEdit.Views
{
    /// <summary>
    /// Interaction logic for ProgressDialog.xaml
    /// </summary>
    public partial class ProgressDialog : Window
    {
        private bool m_taskDone;

        public bool TaskDone
        {
            get { return m_taskDone; }
            set { m_taskDone = value; }
        }
        public string StatusText
        {
            get { return StatusLabel.Content as string; }
            set { StatusLabel.Content = value; }
        }
		public double ProgressValue
		{
			get { return progressBar1.Value; }
			set { progressBar1.Value = value; }
		}
        public ProgressDialog()
        {
            InitializeComponent();
        }

        public bool IsIndeterminate
        {
            get { return progressBar1.IsIndeterminate; }
            set { progressBar1.IsIndeterminate = value; }
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!m_taskDone)
            {
                e.Cancel = true;
            }
        }
    }
}
